<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/msg.jsp"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>注册</title>
	<link rel="icon" href="${project_name}/image/logo.png" >
	<link rel="stylesheet" type="text/css" href="${project_name}/css/login.css"/>
	<script type="text/javascript" src="${project_name}/js/jquery-1.8.3.js"></script>
	<script src="https://cdn.dingxiang-inc.com/ctu-group/captcha-ui/index.js"></script>
	<script type="text/javascript" src="${project_name}/js/register.js"></script>
</head>
<script>
	$(function () {
		var flag = false;
		var myCaptcha = _dx.Captcha(document.getElementById('yzm'), {
			appId: '05e4e0495b6bd88fda37ae0ead5d45f6', //appId，在控制台中“应用管理”或“应用配置”模块获取
			apiServer: '', // 请填写这个配置，按照下面“接入域名”所示!注意：末尾不要有斜杆！
			style: 'oneclick',
			width: '300',
			success: function (token) {
				flag = true
			}
		})
		//表单提交效验
		$('form').submit(function () {
			let no_internet = false
			if(!flag){
				if (no_internet) {
					return true;
				}
				layer.msg('请先通过滑动验证')
				return false;
			}
			return true;
		})
	})
</script>
<body>
<div id="append"></div>
<div class="full_sc">
	<div class="head_cent head_cwo ClearFix">
		<div class="h_logo">
			<a href="index.jsp">
				<img src="${project_name}/image/logo1.png"/>
			</a>
		</div>
		<div class="h_right">
			<img src="${project_name}/image/top_center.jpg"/>
		</div>
	</div>
</div>
<div class="w980 ClearFix">
	<div class="logo_box ClearFix">
		<div class="login_b_l ClearFix">
			<a href="" title="出发">
				<img src="${project_name}/image/register.jpg" alt="出发"/>
			</a>
		</div>
		<div class="login_b_r ClearFix">
			<div class="loginul ClearFix">
				<div class="login_h2 ClearFix">
					<h2>用户注册</h2>
					<div class="lognrtop">
						已有账号<a href="login.jsp">在此登录</a>
					</div>
				</div>
				<div class="co">
					<div class="form">
						<form id="register_form" method="post" action="users/register">
							<div class="item">
								<input placeholder="请输入用户名" class="itxt" maxlength="12" name="username" id="username" type="text" required>
								<div class="err_box">
									<div class="err_msg2 tel" style="display: none"></div>
								</div>
							</div>
							<div class="item items">
								<input placeholder="请输入手机号" class="itxt" maxlength="11" name="tel" id="tel" type="text" required>

								<div class="err_box">
									<div class="err_msg2 msg" style="display: none;">请输入发送给您手机上的验证码</div>
								</div>
							</div>
							<div class="item item2">
								<input placeholder="请输入密码" tabindex="4" maxlength="20" class="itxt" name="password" id="password" type="password" required>
								<div class="err_box">
									<div class="err_msg2" style="display: none;" id="error_password">请输入您的密码,您的密码可能为字母、数字或符号组合</div>
								</div>
							</div>
							<div class="item item2">
								<input placeholder="请再次输入密码" class="itxt" tabindex="5" maxlength="20" name="password_confirm" id="password_confirm" type="password" required>
								<div class="err_box">
									<div class="err_msg2" style="display: none;" id="error_password_confirm">请输入您的密码,您的密码可能为字母、数字或符号组合</div>
								</div>
							</div>
							<div class="item item3" id="yzm">
								<input placeholder="验证码" autocomplete="off" tabindex="6" maxlength="4" size="10" class="itxt itxt_yzm" name="code" id="code" type="text">

								<div class="err_box">
									<div class="err_msg2" style="display: none;" id="error_captcha">请输入右侧验证码</div>
								</div>
							</div>
							<div class="item item5">
								<div class="login-btn">
									<input type="submit" onclick="$('form').submit()" id="registersubmit" value="立即注册" disabled>
								</div>
								<div class="agree">
									<input class="jdcheckbox" tabindex="8" name="agree" id="agree" type="checkbox">
									<label for="agree">同意开心买<span><a href="" target="_blank">《用户服务协议》</a></span>条款</label>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>
